<?php
include "../public/common/common.php";
include "../public/common/config.php";
$id = $_GET['shop_id'];
$sqlShop = "select * from shop where id = {$id}";
$resShop = mysql_query($sqlShop);
$rowShop = mysql_fetch_assoc($resShop);

$sqlBrand = "select brand.* from brand left join shop on(brand.id = shop.brand_id) where shop.id ={$id}";
$resBrand = mysql_query($sqlBrand);
$rowBrand = mysql_fetch_assoc($resBrand);

$class_id = $rowBrand['class_id'];
$brand_id = $rowBrand['id'];
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<?php
		include "header.php"	
		?>
		
		<div class="content">
			<div class="floor">
				<div class="floorHeader">
					<div class="left">
						<span id="">
							<a href="class.php?class_id=<?php echo $class_id?>&brand_id=<?php echo $brand_id?>">品牌</a> &raquo;
							<?php echo $rowShop['name']?>
						</span>
					</div>
				</div>
				<div class="floorFooter2">
					<table>
						<tr>
							<th>图片</th>
							<th>价格</th>
							<th>库存</th>
							<th>购物车</th>
						</tr>
						<tr>
							<td>
								<img src="<?php echo $imgPath . '/thumb_' . $rowShop['img']?>"/>
							</td>
							<td><?php echo $rowShop['price']?>元</td>
							<td><?php echo $rowShop['stock']?></td>
							<td>
								<a href="cart/insert.php?shop_id=<?php echo $rowShop['id']?>">
									<img src="public/img/cart.jpg" width="50"/>
								</a>
							</td>
						</tr>
					</table>
					
				</div>
			</div>
			
			<div class="floor">
				<div class="floorHeader">
					<div class="left">
						<span id="">
							商品评论：
						</span>
					</div>
				</div>
				<div class="floorFooter2">
					<?php
					$sqlComment = "select comment.*,user.username from comment left join user on(comment.user_id = user.id) where comment.shop_id={$rowShop['id']}";
					$resComment = mysql_query($sqlComment);
					while($rowComment = mysql_fetch_assoc($resComment)){
					?>
					<div class="comment">
						<div class="left">
							<div class="logo">
								<img src=""/>
							</div>
							<div class="name">
								<?php echo $rowComment['username']?>
							</div>
						</div>
						<div class="right">
							<?php echo $rowComment['content']?>
						</div>
					</div>
					<?php	
					}
					?>					
				</div>
			</div>
			
		</div>
		

	</body>
	
</html>